package main.java.DMDE.model.relationships.strategy;

import java.util.ArrayList;
import java.util.List;

import main.java.DMDE.model.Diagram;
import main.java.DMDE.model.Entity;

public class AssociationStrategy extends ValidationStrategy{

    public AssociationStrategy(Diagram diagram) {
	super(diagram);
    }

    @Override
    public List<String> getEntitiesA() {
	List<String> entities = new ArrayList<String>();
	for(Entity entity : diagram.getEntities())
		entities.add(entity.getName());
	return entities;
    }

    @Override
    public List<String> getEntitiesB(String entityAName) {
	List<String> entities = new ArrayList<String>();
	for(Entity entity : diagram.getEntities()){
	     if(entity.getName() != entityAName)
		entities.add(entity.getName());
	}	
	return entities;
    }

}
